package games.snake;

import hardware.Display2D;

public class Orange extends SnakeFood{

private	int lifeCounter;	
		
		

/**
 * @author Tavin
 * 
 * Date 1.4.2011
 * 
 * set life counter for orange and make it visible
 */

public void setLifeCounter(int value)
{
	lifeCounter=value;
	visible=true;
}


/**
 * @author Tavin
 * 
 * Date 31.3.2011
 * 
 * Draw Orange
 */

public void draw()
{
	if (!visible)
		return;
	
	
			if (animationCounter<2)
			{
			Display2D.setPixel((byte)xPos,(byte) yPos, (short)0x6f);
			}
		else 
			{
			Display2D.setPixel((byte)xPos,(byte) yPos,(short) 0x24);
			animationCounter=0;
			}


	animationCounter++;

	lifeCounter--;
	
	if (lifeCounter<0)
		visible=false;
	
}


}